package com.woniu.dao;

import com.woniu.dto.NoticePost;
import com.woniu.pojo.Announcement;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AnnouncementMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Announcement record);

    int insertSelective(Announcement record);

    Announcement selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Announcement record);

    int updateByPrimaryKey(Announcement record);

    @Select(value = "select * from announcement am,areainfo ai where am.area_id = ai.id and ai.area_name like concat('%',#{key},'%') order by create_time desc")
    List<NoticePost> selectByKey(@Param("key") String key, @Param("currentPage") Integer page, @Param("pageSize") Integer num);
}